package com.alibaba.aone.casestudy.module.screen;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.fastjson.JSONObject;

public class Async {

	@Autowired
	private HttpServletResponse response;

	public void doComment(Context context) throws IOException {
		System.out.println("yes, you get comment!");
		JSONObject ret = new JSONObject();
		ret.put("name", "zll");
		ret.put("email", "foxmail");
		// context.put("return", ret);
		PrintWriter writer = response.getWriter();
		writer.println(ret);
	}

	public void execute(Context context) {
		System.out.println("yes, you get it!");
		/*JSONObject ret = new JSONObject();
		ret.put("name", "zll");
		context.put("return", ret);*/
		System.out.println("context: "+context.hashCode());
	}
}
